﻿$(document).ready(function() {
    $('.selectQuestion').each(function() {
        $(this).click(function() {
            var questionID = $("#question_question_questionID").val();
            var comparisonQuestionID = $(this).attr('id');
            var type = $("#question_question_type").val();
            $.ajax({
                type: 'POST',
                url: "SelectComparitiveQuestion",
                data: { questionID: questionID, comparisonQuestionID: comparisonQuestionID, type: type },
                success: function() {
                    window.location.href = "Edit" + $('#question_question_type').val() + "?questionID=" + $('#question_question_questionID').val() + "&questionNumber=" + $('#question_question_questionNumber').val() + "&pollID=" + $('#question_poll_pollID').val() + "&pollName=" + $('#question_poll_name').val() + "&saved=true";
                }
            });
        });
    });
});